import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:xm_app/common/global/GlobalService.dart';
import 'package:xm_app/common/ui/KeepAlivePage.dart';
import 'package:xm_app/common/ui/ui_adapter.dart';
import 'package:xm_app/page/whiteboard/WhiteBoardPage.dart';
import 'package:xm_app/r.dart';
import 'package:xm_app/widget/VideoWidget.dart';

import 'fund/FundPage.dart';
import 'gank/GankPage.dart';
import 'home/HomePage.dart';

class MainController extends GetxController {
  var tabBar = [
    BottomNavigationBarItem(
      label: "首页",
      icon: ImageIcon(AssetImage(R.assetsImagesMainHome)),
      activeIcon: ImageIcon(AssetImage(R.assetsImagesMainHomeSelected)),
    ),
    BottomNavigationBarItem(
      label: "妹纸",
      icon: ImageIcon(AssetImage(R.assetsImagesMainChannel)),
      activeIcon: ImageIcon(AssetImage(R.assetsImagesMainChannelSelected)),
    ),
    BottomNavigationBarItem(
      label: "动态",
      icon: ImageIcon(AssetImage(R.assetsImagesMainFollowing)),
      activeIcon: ImageIcon(AssetImage(R.assetsImagesMainFollowingSelected)),
    ),
    BottomNavigationBarItem(
      label: "会员购",
      icon: ImageIcon(AssetImage(R.assetsImagesMainMall)),
      activeIcon: ImageIcon(AssetImage(R.assetsImagesMainMallSelected)),
    ),
    BottomNavigationBarItem(
      label: "我的",
      icon: ImageIcon(AssetImage(R.assetsImagesMainUserCenter)),
      activeIcon: ImageIcon(AssetImage(R.assetsImagesMainUserCenterSelected)),
    )
  ];
  var tabPage = [
    keepAlivePage(HomePage()),
    GankPage(),
    FundPage(),
    WhiteboardPage(),
    Container(color: Colors.greenAccent),
  ];
  final selectedIndex = 0.obs;

  ///页面控制器
  PageController pageController = PageController();

  onTap(index) {
    selectedIndex.value = index;
  }
}
